package com.softeem.cms.controller;

import com.softeem.cms.dto.R;
import com.softeem.cms.entity.User;
import com.softeem.cms.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping("/reg")
    public R registry(User user){
        return userService.addUser(user);
    }

    @GetMapping("/login")
    public R login(User user){
        return userService.userLogin(user);
    }

}
